home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 February: Tool Chest / Apple Developer CD Series Tool Chest February 1996 (Apple Computer)(1996).iso / Sample Code / AOCE Sample Code / PowerTalk Access Modules / Sample SMSAM / SampleSMSAM Source / 2020HalfGateway / 2020HalfGatewayMisc.cp < prev    next >
Encoding:
Text File  |  1995-07-28  |  1.6 KB  |  78 lines  |  [TEXT/R*ch]

  1. /*
  2.     File:        2020HalfGatewayMisc.cp
  3.  
  4.     Copyright:    © 1991-1994 by Apple Computer, Inc.
  5.                 All rights reserved.
  6.  
  7.     Part of the AOCE Sample SMSAM Package.  Consult the license
  8.     which came with this software for your specific legal rights.
  9.  
  10. */
  11.  
  12.  
  13.  
  14. #ifndef __2020HALFGATEWAYMISC__
  15. #include "2020HalfGateway.h"
  16. #endif
  17.  
  18. #ifndef __UTILITIES__
  19. #include "Utilities.h"
  20. #endif
  21.  
  22. /***********************************|****************************************/
  23.  
  24. Boolean ValidRecipientType (RecipientTypeSet recipient)
  25. {
  26.     switch (recipient)
  27.     {
  28.         case fromRecipient:
  29.         case toRecipient:
  30.         case ccRecipient:
  31.             return true;
  32.         case bccRecipient:
  33.         default:
  34.             return false;
  35.     }
  36.  
  37.     return false;
  38. }
  39.  
  40. /***********************************|****************************************/
  41.  
  42. short ConvertRecipientTypeSettoAMAttribute (RecipientTypeSet recipient)
  43. {
  44.     switch (recipient)
  45.     {
  46.         case fromRecipient:
  47.             return kMailFromBit;
  48.         case toRecipient:
  49.             return kMailToBit;
  50.         case ccRecipient:
  51.             return kMailCcBit;
  52.         case bccRecipient:
  53.             return kMailBccBit;
  54.     }
  55.     return -1;
  56. }
  57.  
  58. /***********************************|****************************************/
  59.  
  60. void MakeMailAttributeBitmap (MailAttributeBitmap& attribute, unsigned long valueToSet)
  61. {
  62.     CLEARBLOCK ( attribute )
  63.     * (long *) &attribute = valueToSet;
  64. }
  65.  
  66. /***********************************|****************************************/
  67.  
  68. MailAttributeBitmap MakeMailAttributeBitmap ( unsigned long valueToSet )
  69. {    MailAttributeBitmap attribute;
  70.     CLEARBLOCK ( attribute )
  71.     * (long *) &attribute = valueToSet;
  72.     
  73.     return attribute;
  74. }
  75.  
  76. /***********************************|****************************************/
  77.  
  78.